﻿using System;
using AnimatingHair.Entity;
using OpenTK;
using OpenTK.Graphics.OpenGL;

namespace AnimatingHair.Auxiliary
{
    class ParticlePair
    {
        public HairParticle Particle1 { get; set; }
        public HairParticle Particle2 { get; set; }

        public int I { get; set; }
        public int J { get; set; }

        public double A { get; set; }
        public double C { get; set; }
        public double K { get; set; }
        public double L { get; set; }
        public Vector3d T { get; set; }
        public double Alpha { get; set; }
        public double Theta { get; set; }
        public double SinTheta { get; set; }
        public double CosTheta { get; set; }
        public Vector3d X { get; set; }
        public double XLength { get; set; }

        public void Render()
        {
            if ( Const.W( XLength, Particle1.hair.H1 ) > 0.0001 )
            {
                GL.Color3( 0.6, 0.8, 0.1 );
                GL.Begin( BeginMode.Lines );
                GL.Vertex3( (Vector3)Particle1.Position );
                GL.Vertex3( (Vector3)Particle2.Position );
                GL.End();
            }
        }

        public override string ToString()
        {
            return Particle1.ID + " " + Particle2.ID;
        }
    }
}
